import request from '@/utils/request'

export function produceFactoryList(id, name, pageIndex, pageSize) {
  return request({
    url: '/masterdata/maManufacturer/queryList',
    method: 'get',
    params: {
      id,
      name,
      pageIndex,
      pageSize
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'

  })
}

// 查询生产厂家
export function selectFactory(id, name, pageIndex, pageSize) {
  return request({
    url: '/masterdata/maManufacturer/queryList',
    method: 'get',
    params: {
      id,
      name,
      pageIndex,
      pageSize
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqGet'

  })
}

// //添加生产厂家
export function addFactory(obj) {
  return request({
    url: '/masterdata/maManufacturer/add',
    method: 'post',
    params: {},
    data: {
      'address': obj.address,
      'contacts': '321312',
      'id': obj.id,
      'name': obj.name,
      'nameSimple': obj.nameSimple,
      'phone': obj.phone,
      'remark': obj.remark,
      'version': obj.version
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqPost'

  })
}
// 修改生产厂家
export function updateFactory(obj) {
  return request({
    url: '/masterdata/maManufacturer/update',
    method: 'put',
    params: {},
    data: {
      'address': obj.address,
      'contacts': '321312',
      'id': obj.id,
      'name': obj.name,
      'nameSimple': obj.nameSimple,
      'phone': obj.phone,
      'remark': obj.remark,
      'version': obj.version
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqPut'

  })
}

// 删除生产厂家
export function deleteFactory(id) {
  return request({
    url: '/masterdata/maManufacturer/delete',
    method: 'delete',
    params: {
      id
    },
    port: { ENV_PORT: 8003 },
    ajaxType2: 'reqDelete'

  })
}
